package cn.iocoder.yudao.hires.mapper;

import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.yudao.hires.entity.NoticeApplicationDO;
import cn.iocoder.yudao.hires.vo.NoticeApplicationPageReqVO;
import cn.iocoder.yudao.hires.vo.PostTionShortVo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * 下游-投递记录 Mapper
 *
 * @author 超级管理员
 */
@Mapper
public interface NoticeApplicationMapper extends BaseMapperX<NoticeApplicationDO> {

    default PageResult<NoticeApplicationDO> selectPage(NoticeApplicationPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<NoticeApplicationDO>().eqIfPresent(NoticeApplicationDO::getUserId, reqVO.getUserId()).eqIfPresent(NoticeApplicationDO::getResumeId, reqVO.getResumeId()).likeIfPresent(NoticeApplicationDO::getCompanyName, reqVO.getCompanyName()).eqIfPresent(NoticeApplicationDO::getPositionId, reqVO.getPositionId()).likeIfPresent(NoticeApplicationDO::getPositionName, reqVO.getPositionName()).betweenIfPresent(NoticeApplicationDO::getApplicationTime, reqVO.getApplicationTime()).eqIfPresent(NoticeApplicationDO::getStatus, reqVO.getStatus()).betweenIfPresent(NoticeApplicationDO::getFeedbackTime, reqVO.getFeedbackTime()).eqIfPresent(NoticeApplicationDO::getFeedbackContent, reqVO.getFeedbackContent()).eqIfPresent(NoticeApplicationDO::getIsRead, reqVO.getIsRead()).eqIfPresent(NoticeApplicationDO::getMark, reqVO.getMark()).eqIfPresent(NoticeApplicationDO::getSource, reqVO.getSource()).betweenIfPresent(NoticeApplicationDO::getCreateTime, reqVO.getCreateTime()).orderByDesc(NoticeApplicationDO::getId));
    }

    List<NoticeApplicationDO> getNoticeApplicationMySelfList(
            @Param("positionId") Integer positionId,
            @Param("positionName") String positionName,
            @Param("tenantId") Long tenantId,
            @Param("userId") Long userId,
            @Param("status") Integer status
    );


    /**
     * 查询职位id  获取职位的行业字典值
     * @param positionId  行业id
     * @return  获取职位的字典值
     */
    PostTionShortVo getCategory(Long positionId);
}